// 用户Schema设计

var mongoose = require('mongoose'),
  Schema = mongoose.Schema;

// Schema建模
var UserSchema = new Schema({
    // 用户名称
    name: {type: String, required: true},
    // 用户邮箱
    email: {type: String, required: true},
    // 用户密码
    password: {type: String, required: true},
    // 用户创建时间
    created: {type: Date, default: Date.now}
});

// 生成Model
mongoose.model('User', UserSchema);
